UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zOAg2UlP7ZkCrdvaAK+877PIQUJXd1xOcuWI6xj6Tjc='
WHERE
key_id = 'a9013f13fcdb811f6a87bae46e14800444ecf828f0ca05d93834fe5ec8e9f05f'
AND (
token = 'zOAg2UlP7ZkCrdvaAK+877PIQUJXd1xOcuWI6xj6Tjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)