UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VmaTPbv1YHxKvfQFuZxC+pgk/8U7qhj1Qb+PAwWTlRo='
WHERE
key_id = '82c5fadfee2fef6557ede4176dd64b6020c1f3419dcacaba8dc237164867475b'
AND (
token = 'VmaTPbv1YHxKvfQFuZxC+pgk/8U7qhj1Qb+PAwWTlRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)