UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nc61JQrK5wzu88NHX3UdpnlA1e34/FY89aP6MDMCmdI='
WHERE
key_id = 'd7d655a7ed9708c982e0eea56119cddc0087049661095181f072cd4eb70359fb'
AND (
token = 'Nc61JQrK5wzu88NHX3UdpnlA1e34/FY89aP6MDMCmdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)