UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j1XDr64AV4FRR6vFNZE/w1i8iO2St5zMN+XFDhUFsyQ=' 
WHERE 
  key_id = '0574c481a5c81fd95ae26eaa84bd8b232e90c965a66d4d40b061f6a2360cfdfa' 
  AND (
    token = 'j1XDr64AV4FRR6vFNZE/w1i8iO2St5zMN+XFDhUFsyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032