UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M90nZXGffPClk9NRQ8ikQ5cNw0UUh+qh5mbpHb3ybNw=' 
WHERE 
  key_id = 'd3dcbec66c604e6cd618d7a334363268c1d214fcf7e94d9459a02ed66253e654' 
  AND (
    token = 'M90nZXGffPClk9NRQ8ikQ5cNw0UUh+qh5mbpHb3ybNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050