UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SZIWg2F0l6f39oK//kkamnPTwlLKylZ1P/n24IB1CyU='
WHERE
key_id = 'ac05d87f34c83d86c23544aab0570107b973979d760bebe66454cc91d7754fbb'
AND (
token = 'SZIWg2F0l6f39oK//kkamnPTwlLKylZ1P/n24IB1CyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)