UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Z4bdoeROx3x8d54i74vWeKbMadbLla0nzW+SN0UtkE=' 
WHERE 
  key_id = 'd53ad8f14da7670f4cd303a30199be2af79a985ddceb7ff1e469eee056a2aafe' 
  AND (
    token = '6Z4bdoeROx3x8d54i74vWeKbMadbLla0nzW+SN0UtkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052