UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hnvcdHVDAeZyJMG97CALO5NpLxmJvpKCrsJKXR3k1ec='
WHERE
key_id = '8a5fae4a259de1969d5276b9db2d89489f6418d17123726c4bf0fb9eabcbecdc'
AND (
token = 'hnvcdHVDAeZyJMG97CALO5NpLxmJvpKCrsJKXR3k1ec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)