UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PabIkD82cxh61SY0fiXD1BLBDt23KiXsCEhLatpig5k=' 
WHERE 
  key_id = 'f2ddf86f70019e482ac2cf8c2879e8cff8d5a4795138d6eeeb02dffaa258c06f' 
  AND (
    token = 'PabIkD82cxh61SY0fiXD1BLBDt23KiXsCEhLatpig5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034