UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZR8fBBYDqfa7XkwlS2NGc4rQYqEnWHtULZUPnJX7yvM='
WHERE
key_id = '99c6b91849fb5da42422b056df75a601bcaeea16c86b0200580ea4346da80f50'
AND (
token = 'ZR8fBBYDqfa7XkwlS2NGc4rQYqEnWHtULZUPnJX7yvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)