UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l6VV1ZT1K437mDgFpIeXOuboC7801S7YwREWfk87gU4='
WHERE
key_id = 'ea953d76219f2194641b2a4c6382e2b9684bf9ea968e277a49d0f06f63d7a351'
AND (
token = 'l6VV1ZT1K437mDgFpIeXOuboC7801S7YwREWfk87gU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)