UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ZqCKywvZo/TqAVPdAfuw3DmidFGqSy8JmmiZR+TGhU='
WHERE
key_id = '94f4e986fb531eebfb13778ef222fbbbfc57c230389933a16ec91ef897ab3b69'
AND (
token = '0ZqCKywvZo/TqAVPdAfuw3DmidFGqSy8JmmiZR+TGhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)