UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '16IzmKUzJ4+cWaIe8df1UVOV5pkvqKTTyczXg3hK2eI='
WHERE
key_id = '75fc53f38ceba2a0dd7f4f4af243fcef9495d8a77e0b22ce58858ef6786f1644'
AND (
token = '16IzmKUzJ4+cWaIe8df1UVOV5pkvqKTTyczXg3hK2eI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)