UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LDW5sxiD/DQKJeN2lfSnTWbHVwEq0yqhUvAupglH//E='
WHERE
key_id = '55ca4ebd49bffbc4be158dedb64765d7c0b1f2afe871940a7e79a0c271e4515a'
AND (
token = 'LDW5sxiD/DQKJeN2lfSnTWbHVwEq0yqhUvAupglH//E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)