UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k2h4EerX1eKlEqP4QZe8Zp7JGRz4aHwH1MaOXK/uWU8='
WHERE
key_id = '83c19c52c1ae35d236711eb3291108a0a7574850ebdeec3170476f8289348c26'
AND (
token = 'k2h4EerX1eKlEqP4QZe8Zp7JGRz4aHwH1MaOXK/uWU8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)