UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l29BadeVSU3nvyDKaglpBUy+Zg/oW2eNZ6boxEP7b+M='
WHERE
key_id = 'de189f66567a8e709c9e5c02f123cbe2d667d17f2f2a6a7b5268ae07976c1162'
AND (
token = 'l29BadeVSU3nvyDKaglpBUy+Zg/oW2eNZ6boxEP7b+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)