UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mvtQXclNxThoRi8LIFiBGmBsg1i8I7v3fMp1In3u1C8='
WHERE
key_id = '3272345dfc9e028b455abf8e3b0c71ad31c2b812aba5292597c1b57194a47f63'
AND (
token = 'mvtQXclNxThoRi8LIFiBGmBsg1i8I7v3fMp1In3u1C8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)