UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ekqI8FMShc0G4kLoch/74JNi9I1eB8E1eaHr856QJqU=' 
WHERE 
  key_id = 'c93d074bea11f9c30166b5201c37d8c634d44daf219c8c4ac6c64c5ae780a8e2' 
  AND (
    token = 'ekqI8FMShc0G4kLoch/74JNi9I1eB8E1eaHr856QJqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021