UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ue8RBH5SnHwV9C0upJrHnG9zv5cDmtr6RYVUwy/TBOA='
WHERE
key_id = '405db42e8fdeda91811706c64bd1862dd2d96c168d8daaf16003102425f10c60'
AND (
token = 'ue8RBH5SnHwV9C0upJrHnG9zv5cDmtr6RYVUwy/TBOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)