UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nfZbi0Ucju+erbYfElb65Onk/+I9aLgVB7l88yF4yng=' 
WHERE 
  key_id = '10eb019634c382249149708b49dd1c52b5899f9d628fed86a62b7144f7b54b18' 
  AND (
    token = 'nfZbi0Ucju+erbYfElb65Onk/+I9aLgVB7l88yF4yng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032