UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xu61w6C6USO1G/rA4sItt7E5Y77k4JDTx9KCnKVblNU=' 
WHERE 
  key_id = 'b9418620d40cc5f10ea26c50fdf405ad7a463e07a9b8df4808a137331f6b9645' 
  AND (
    token = 'xu61w6C6USO1G/rA4sItt7E5Y77k4JDTx9KCnKVblNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063