UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cE1PBr8J9ciCLI2l+k9FbzZO5ZmfiN6MoSKgDu2KruU='
WHERE
key_id = '032027e77b2ea6255d8ffa926e00613609858db16a988bb7df3b06d713d591f7'
AND (
token = 'cE1PBr8J9ciCLI2l+k9FbzZO5ZmfiN6MoSKgDu2KruU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)