UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E2QIbR0zPQ1dxCoslQrHJd8jpafq0eD4iBBWA5CLFyo=' 
WHERE 
  key_id = '71b77fcf8a640a91259e755b97ef5ad060bfaca7cbfdea56b9853f54b9029fcd' 
  AND (
    token = 'E2QIbR0zPQ1dxCoslQrHJd8jpafq0eD4iBBWA5CLFyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034