UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4+iYqBMhN9UUocyQjXeOKkpQwV2nPy6/0zLAqKAB5OA=' 
WHERE 
  key_id = '8670f867895235824ae14e39c3fa73d191c65f023cf00593774a06388b10066f' 
  AND (
    token = '4+iYqBMhN9UUocyQjXeOKkpQwV2nPy6/0zLAqKAB5OA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025