UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7e9/AHt/pJKRx9NWAwcjLOk8j6NMKr4BijP2y8OVbbc=' 
WHERE 
  key_id = '27a64e2dd1c2295d8e7491b4068002433933deefe62a60fba6c505fb34b540d6' 
  AND (
    token = '7e9/AHt/pJKRx9NWAwcjLOk8j6NMKr4BijP2y8OVbbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023