UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cvOUZai3jPpPTZzfApR/aE6WyLEmgyIrwzUrscWQTX8=' 
WHERE 
  key_id = 'bc7f116289c86e623bcb47dfb5bb9a44185bd95fef62eba0521539839f13c3bb' 
  AND (
    token = 'cvOUZai3jPpPTZzfApR/aE6WyLEmgyIrwzUrscWQTX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026