UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qp88543Y5HNGmRupore6LJSm9fbjg9i2ZaFAS8HBJh8='
WHERE
key_id = '28798e1d49aa4c3dc6bee5082ebc828f312a2d9045694fccee4e8bfc6078214c'
AND (
token = 'qp88543Y5HNGmRupore6LJSm9fbjg9i2ZaFAS8HBJh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)