UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w96O9zSYu+ip/M2NXbBDeRM2iAJJzdSLi8t/JwNPdpU='
WHERE
key_id = 'ddb74838966659a5b65dea3281ac54f26d79a3acb910d304f08f96da2a487ddd'
AND (
token = 'w96O9zSYu+ip/M2NXbBDeRM2iAJJzdSLi8t/JwNPdpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)