UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jGvV+s68wlVpT1GtFBRYG2mimaY/aYRVjRQ28Z+XK/Y=' 
WHERE 
  key_id = '07f053eaee5b5671b49c1424da0f283e44a6190c660d19fa983e3d1dc7c074fc' 
  AND (
    token = 'jGvV+s68wlVpT1GtFBRYG2mimaY/aYRVjRQ28Z+XK/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042