UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kpnZFdbM1i/P1v7YsQ/6NskZFrg/TsgTpbMSN8P+nPA=' 
WHERE 
  key_id = 'd019ba2462dfd5a6099a72c250953be82c5ca9b3c7489555a1af6621a9a0a069' 
  AND (
    token = 'kpnZFdbM1i/P1v7YsQ/6NskZFrg/TsgTpbMSN8P+nPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055