UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xmcgr9vRZ9jKU8bmIm0NMAHOtom/aIWDFcWBnrVLQLQ='
WHERE
key_id = 'a3fbedf821f014779552c75f3e553b3446f343ebb48bbfc0e8b7b5fdeb6e21ff'
AND (
token = 'Xmcgr9vRZ9jKU8bmIm0NMAHOtom/aIWDFcWBnrVLQLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)