UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QjlMceJ1sltJIgdT0vuM9Nm7W2JJgvcOZcM8jq2C9VU=' 
WHERE 
  key_id = '029f7eef1d49a2306b2b105a01b75802ddabf8f3fea36c31ac8d444c67e36173' 
  AND (
    token = 'QjlMceJ1sltJIgdT0vuM9Nm7W2JJgvcOZcM8jq2C9VU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018