UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WP2pRbUZtHoX9IzGeseqDtI87DiniAr+kfCezaLmZGo=' 
WHERE 
  key_id = '84e28b74dca67ee15c2a20b1075bd5468ff26ac9cdf02be29bb507033e247275' 
  AND (
    token = 'WP2pRbUZtHoX9IzGeseqDtI87DiniAr+kfCezaLmZGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063