UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGj3MLvn9kZnKsJDTvT4ww+QQlnOYK4iBsF4doJIWeU='
WHERE
key_id = '1769a4c2d63fc56a1e4740c3d8b4ead0b70bffdd64bec163844da6f9203c4cdb'
AND (
token = 'oGj3MLvn9kZnKsJDTvT4ww+QQlnOYK4iBsF4doJIWeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)