UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gyN0tT6aFaY8thgFkrkCrWMJA+KMufgjmON+dlXe/4s=' 
WHERE 
  key_id = '256f58fc3c9dfac13844af3cafab4f0f40028e5feaeb1821b8cc7ae30fd13e48' 
  AND (
    token = 'gyN0tT6aFaY8thgFkrkCrWMJA+KMufgjmON+dlXe/4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043