UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QZ5b6LHmjORQ9kIIWTcsC05/M8/Q1rhaWkI9lhSX9qw='
WHERE
key_id = 'eede190d9af99223745212b57f97890adbfa02e79f1cf94d00aa1037f4527349'
AND (
token = 'QZ5b6LHmjORQ9kIIWTcsC05/M8/Q1rhaWkI9lhSX9qw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)