UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSGddDA1vpKGyj7M2BlVuI64Vqnb+AkKN1hA3qpWBAk='
WHERE
key_id = '597941118075c149d810183a736c9680b81b497d2a4e58da3670288022160c75'
AND (
token = 'HSGddDA1vpKGyj7M2BlVuI64Vqnb+AkKN1hA3qpWBAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)