UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3VW9So/VtgYQw6GsYBN3wJQJRjejB06T8M9R5cHc8IQ=' 
WHERE 
  key_id = '41b423c947dc52bb45a14c4928b6c321165b2067724085a5d6723f24d1b26380' 
  AND (
    token = '3VW9So/VtgYQw6GsYBN3wJQJRjejB06T8M9R5cHc8IQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048