UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4rK3dt8AYZ4sd/sO0omBTuoZTXvHjRn5WchaWvU9Fds=' 
WHERE 
  key_id = '8b7a4e4a0511e51c7ea2ec04f75808bb4b90d61f1ddb82fde211cbd6eaaedd50' 
  AND (
    token = '4rK3dt8AYZ4sd/sO0omBTuoZTXvHjRn5WchaWvU9Fds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031