UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l4c0VWI6bewoEmdrzOIbqS+y8gXe0Ct9+shAWLrbNiw=' 
WHERE 
  key_id = '159cece1a61e7fea01bd8f6f40811b94a91d3ed5feb73467e7d373df4ad96153' 
  AND (
    token = 'l4c0VWI6bewoEmdrzOIbqS+y8gXe0Ct9+shAWLrbNiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024