UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h2EVD5ayzP2rZW5VlAI0JbvVFj2aJRUl70xFE/FAcAo=' 
WHERE 
  key_id = '8bdc7c400e4b4a28285f81de59fc0c4c06a731f2dbe31dc32ea889b5fda5f7f0' 
  AND (
    token = 'h2EVD5ayzP2rZW5VlAI0JbvVFj2aJRUl70xFE/FAcAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048