UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/7tidFz26aO9tGWrSHKQbjONnn6NqlvsxoYhOjnPfnY=' 
WHERE 
  key_id = '547735cb029bbde6dc9ba3ee319f620152df78cbd1da9a7a8382301ff802b3d1' 
  AND (
    token = '/7tidFz26aO9tGWrSHKQbjONnn6NqlvsxoYhOjnPfnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016