UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mth6eBlWhFDK3l4bk2EbnFgH1BWc3DwjYtAHEDP/LhU=' 
WHERE 
  key_id = '032cbb312026820ad36436a50e54f6945b15179a83172d194ec19857c4f781ae' 
  AND (
    token = 'Mth6eBlWhFDK3l4bk2EbnFgH1BWc3DwjYtAHEDP/LhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024