UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qDXBJenjDyNTlgsVds34rMDq6QypLXzTxLg3GZ5HbpI='
WHERE
key_id = '0488142f7d42789e12a64c2ee8f1d30dd5af9830d2688ea1ae76a2122dde3419'
AND (
token = 'qDXBJenjDyNTlgsVds34rMDq6QypLXzTxLg3GZ5HbpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)