UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R9Zt6WZKnu8nH+kj/WU4lqTgX8Eaugxm+ORowDokH5c=' 
WHERE 
  key_id = '85d9c99034e0782927f2029dd82f142bf93b7fc3cf2c05eecbc7ad23f12de8a7' 
  AND (
    token = 'R9Zt6WZKnu8nH+kj/WU4lqTgX8Eaugxm+ORowDokH5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028