UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0bsWdUf5QLmSsGW6fIbSW+EfXAEuVy4M+UfdkFD46GM='
WHERE
key_id = '624debb63f3a3c76206c51d071a9f7c6667b7574c75dd4d1fe69a423abd515af'
AND (
token = '0bsWdUf5QLmSsGW6fIbSW+EfXAEuVy4M+UfdkFD46GM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)