UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wLQ2AVaLdMtVBVTHfNXe725JJ+ZxmorQJrOjUZqZfoY='
WHERE
key_id = '120d765b313e92c56877e72b9394cd279c38c25c7a4e940f83e78ae04ece479b'
AND (
token = 'wLQ2AVaLdMtVBVTHfNXe725JJ+ZxmorQJrOjUZqZfoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)