UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMFNsLHzbLO5IrZR7lfjMKtBZaDgzgF/cLIanTR9Z48=' 
WHERE 
  key_id = '8a079853cf2ccba0ae8de575a17364d3e090275cb177928628750fb4cb6f20fe' 
  AND (
    token = 'ZMFNsLHzbLO5IrZR7lfjMKtBZaDgzgF/cLIanTR9Z48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033