UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V0zKzRbVi531zrR2wBf+WkclPtD5yvWwZoKLZF6K1GM='
WHERE
key_id = '0e817562bdfc415ee2a57946565bc5edd94e7c4617509f316db9319fbeba335f'
AND (
token = 'V0zKzRbVi531zrR2wBf+WkclPtD5yvWwZoKLZF6K1GM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)