UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2L+vkNpAdzW/D5Sre5dmcPKr7REjwWnu+5i/yP9PACI=' 
WHERE 
  key_id = 'b07055fae06ada007767dc10a0fae765bf100b7a997627cbdc2bd7bf762d2e49' 
  AND (
    token = '2L+vkNpAdzW/D5Sre5dmcPKr7REjwWnu+5i/yP9PACI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031