UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9b0J6tb8CEDQYNK8x2EoQhdfOGAq7WwaIn4Tb/jSZVo=' 
WHERE 
  key_id = 'c0357f206e250e162b8ab593e3b8d1068526374d3709950c13f7c42aa66d384d' 
  AND (
    token = '9b0J6tb8CEDQYNK8x2EoQhdfOGAq7WwaIn4Tb/jSZVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028