UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6UcCmU6I0agZSAgLpBNy3VtEwIQYzHn5FyBz7HIKc94=' 
WHERE 
  key_id = '45acdd10338cfd2e936c84d5f2747306711a91c2480b6ac2efc673005f958286' 
  AND (
    token = '6UcCmU6I0agZSAgLpBNy3VtEwIQYzHn5FyBz7HIKc94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030