UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9GT+Sg8B5taWysVIg+7iZyvs4QsmFUtkL5OwT9EhuT0=' 
WHERE 
  key_id = '028ebc7ca6318cbe16447b522c76fde714531cfd1957d9765acd198a68803cc2' 
  AND (
    token = '9GT+Sg8B5taWysVIg+7iZyvs4QsmFUtkL5OwT9EhuT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026