UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '454YUlgnBP9TY/dsrLKHx/U6lw70UQWjEROieXstKHw=' 
WHERE 
  key_id = 'f04bbad883d6f3e14c7e4e541332d74d539569b633629b5a4f9663f172eaf134' 
  AND (
    token = '454YUlgnBP9TY/dsrLKHx/U6lw70UQWjEROieXstKHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037