UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dqKEXNvnKBtl1LFXlP99/0gdWAa+X6s1IQweaw9GkJQ=' 
WHERE 
  key_id = '4015f83d86d9ba5f4e9b4dc9c1a921aadc58fb19a154fea2cac32125f575635b' 
  AND (
    token = 'dqKEXNvnKBtl1LFXlP99/0gdWAa+X6s1IQweaw9GkJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047